home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 January: Mac OS SDK / Dev.CD Jan 96 SDK / Dev.CD Jan 96 SDK1.toast / Development Kits (Disc 1) / AppleScript / Development Tools / Tools Goodies / AEGizmos 1.3 / AEStream.h < prev    next >
Encoding:
Text File  |  1992-09-17  |  2.2 KB  |  73 lines  |  [TEXT/KAHL]

  1. ////
  2. ////    AEStream.h                A (write-only) stream for creating AE Descriptors.
  3. ////
  4. ////    By Jens Alfke            ©1991-1992 Apple Computer, Inc. All rights reserved.
  5. ////
  6.  
  7.  
  8. #ifdef THINK_C
  9. #pragma once                                        /* For THINK C users */
  10. #endif
  11.  
  12. #ifndef __AESTREAM__
  13. #define __AESTREAM__                                /* For poor MPW users :) */
  14.  
  15.  
  16. #include <AppleEvents.h>
  17.  
  18.  
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22.  
  23. // The "AEStream_CPlus.h" header is no longer automatically included. You can include it
  24. // yourself instead of this one if you want to use the object-based syntax in C++.
  25.  
  26.  
  27. #define errAEStream_BadNesting    13579    /* Bad descriptor/array nesting error */
  28.  
  29.  
  30. typedef struct {                // A (write-only) stream on an AE descriptor
  31.     Handle    data;                    // The data
  32.     Size    size;                    // Current size of handle [same as GetHandleSize(data)]
  33.     Size    index;                    // Current index (into data handle) to write to
  34.     Size    headIndex;                // Offset of header [type field] of open descriptor
  35.     char    context;                // What context am I in? [enum]
  36.     char    isEvent;                // Is this an Apple Event? [Boolean]
  37. } AEStream, *AEStreamRef;
  38.  
  39.  
  40. OSErr    AEStream_Open        ( AEStreamRef ),
  41.         AEStream_Close        ( AEStreamRef, AEDesc *desc ),
  42.  
  43.         AEStream_OpenDesc    ( AEStreamRef, DescType type ),
  44.         AEStream_WriteData    ( AEStreamRef, const void *data, Size length ),
  45.         AEStream_CloseDesc    ( AEStreamRef ),
  46.  
  47.         AEStream_WriteDesc    ( AEStreamRef, DescType type, const void *data, Size length ),
  48.         AEStream_WriteAEDesc( AEStreamRef, const AEDesc *desc ),
  49.  
  50.         AEStream_OpenList    ( AEStreamRef ),
  51.         AEStream_CloseList    ( AEStreamRef ),
  52.  
  53.         AEStream_OpenRecord    ( AEStreamRef, DescType type ),
  54.         AEStream_SetRecordType( AEStreamRef s, DescType type ),
  55.         AEStream_CloseRecord( AEStreamRef ),
  56.  
  57.         AEStream_WriteKeyDesc(AEStreamRef, AEKeyword key, DescType type, const void *data, Size length ),
  58.         AEStream_OpenKeyDesc( AEStreamRef, AEKeyword key, DescType type ),
  59.         AEStream_WriteKey    ( AEStreamRef, AEKeyword key ),
  60.  
  61.         AEStream_CreateEvent( AEStreamRef, AEEventClass, AEEventID,
  62.                                 DescType targetType, const void *targetData, long targetLength,
  63.                                 short returnID, long transactionID ),
  64.         AEStream_OpenEvent    ( AEStreamRef, AppleEvent* ),
  65.         AEStream_OptionalParam( AEStreamRef, AEKeyword key );
  66.  
  67. #ifdef __cplusplus
  68. }
  69. #endif
  70.  
  71.  
  72. #endif
  73.